<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>demo6</title>
    <script src="../build/react.js"></script>
    <script src="../build/react-dom.js"></script>
    <script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type='text/babel'>
var MyTitle = React.createClass({
    propTypes: {
        title: React.PropTypes.string.isRequired,
    },
    getDefaultProps: function() {
        return {
            title: 'default title'
        };
    },
    render: function() {
        return <h1> {this.props.title} </h1>
    }
})
var data = '123';
ReactDOM.render(
    <MyTitle title={data} />,
    document.getElementById('example')
)

</script>
</body>
</html>
